import axios from '@/utils/http'

interface ILoginParameter {
    Name?: string,
    UserAgent?: string,
    Ip?: string,
    Mobile: string,
    Password: string,
}

interface ILoginData {
    access_token: string;
    expires_in: number;
    token_type: string;
}

export function Login(parameter: ILoginParameter) {
    return axios<ILoginData>({
        url: '/user/auth/login',
        method: 'post',
        data: parameter
    })
}


interface IUserinfoData {
    id: number;
    name: string;
    [key: string]: any
}

export function UserInfo() {
    return axios<IUserinfoData>({
        url: '/user/auth/info',
        method: 'post',
    })
}

